<div class="col-xs-9">
<table border=".5">
		<tr><th>NAME</th>
		<th>EMAIL</th>
		<th>ACCOUNT TYPE</th>
		<th>DEPARTMENT</th>
		<th></th></tr>
<?= form_open('index.php/rmis/management/grantAction')?>
			<?php if(isset($msg)):?>
				<?php echo "<tr><td colspan=\"4\">".$msg."</td></tr> </table>"?>
			<?php else : ?>
				<?php if ($count < 10): ?>
					<?php $i = 0; foreach ($det as $mem) : ?>
						<tr><td> <?php echo "".$mem[0]['LastName'].", ".$mem[0]['FirstName']." ".$mem[0]['MiddleName'] ?> </td>
						<td><?php echo "".$mem[0]['Email'] ?></td>
						<td><?php $var = "".$mem[0]['MemberID'] ?>
							<?php $var = substr($var,0,1) ?>
							<?php switch ($var){
								case '1':	echo "Faculty";
									break;
								case '2':	echo "Student";
									break;
								} ?></td>
						<td><?php echo $dep[$i][0]['DeptDesc']; $i++; ?></td>
						<td>
							<button name='A' type='submit' 
								value='<?php echo $mem[0]['MemberID'] ?>' 
								onclick='return confirm(\"Are you sure you want to grant this account?\")'>
								Allow</button>
							<button name='R' type='submit' 
								value='<?php echo $mem[0]['MemberID'] ?>' 
								onclick='return confirm(\"Are you sure you want to reject this account?\")'>
								Reject</button>
							<!-- <input type="submit" value="Allow" name="A"> 
							<input type="submit" value="Reject" name="R">
							<input type="hidden" value="" name="ID"> -->
						</td>

				<?php endforeach ?>
				</table>
				VIEW <?php echo sizeof($det) ?> of <?php echo sizeof($det) ?> 
				<input type="submit" value="Prev" disabled="disabled"> 
				<input type="submit" value="Next" disabled="disabled">
			<?php else : ?>
				<?php $i = 0; foreach ($det as $mem) : ?>
					<?php if($i < 10): ?>
						<tr><td> <?php echo "".$mem[0]['LastName'].", ".$mem[0]['FirstName']." ".$mem[0]['MiddleName'] ?> </td>
						<td><?php echo "".$mem[0]['Email'] ?></td>
						<td><?php $var = "".$mem[0]['MemberID'] ?>
							<?php $var = substr($var,0,1) ?>
							<?php switch ($var){
								case '1':	echo "Faculty";
									break;
								case '2':	echo "Student";
									break;
								} ?></td>
						<td><?php echo $dep[$i][0]['DeptDesc']; $i++; ?></td>
						<td>
							<button name='A' type='submit' 
								value='<?php echo $mem[0]['MemberID'] ?>' 
								onclick='return confirm(\"Are you sure you want to grant this account?\")'>
								Allow</button>
							<button name='R' type='submit' 
								value='<?php echo $mem[0]['MemberID'] ?>' 
								onclick='return confirm(\"Are you sure you want to reject this account?\")'>
								Reject</button>
							<!-- <input type="submit" value="Allow" name="A"> 
							<input type="submit" value="Reject" name="R">
							<input type="hidden" value="" name="ID"> -->
						</td>
					<?php else: ?>
						<input type="hidden" value="<?php echo "".$i ?>" name="Counter" />
						<?php break; ?>
					<?php endif ?>
				<?php endforeach ?>
				</table>
				VIEW 10 of <?php echo sizeof($det) ?> <input type="submit" name="PREV" value="Prev"> <input type="submit" name="NEXT" value="Next">
			<?php endif ?>	
		<?php endif ?>
</div>
<?= form_close()?>